package org.jypj.dev.util;

import org.jypj.dev.vo.CountVo;
import org.jypj.dev.vo.TodayScore;

import java.util.List;

/**
 * Created by ChenYu on 2017-02-24.
 */
public class UserScoreUtil {

    /**
     * 得到得分总人数以及设置分段人数
     * @param countVos
     * @return
     */
    public  static void getUserNumAndSetScoreSpan(List<CountVo> countVos, TodayScore ts){
        int userNum=0;
        int[] datas=new int[5];
        for(int i=0;i<5;i++){
            int num=countVos.get(i).getCountNum();
            datas[i]=num;
            switch (i) {
                case 0:
                    ts.setNumOf90_100(num);
                    break;
                case 1:
                    ts.setNumOf80_90(num);
                    break;
                case 2:
                    ts.setNumOf70_80(num);
                    break;
                case 3:
                    ts.setNumOf60_70(num);
                    break;
                case 4:
                    ts.setNumOfBelow60(num);
                    break;
            }
            userNum+=num;
        }
        ts.setUserNum(userNum);
        ts.setCountDatas(datas);
    }

}
